<template>
	<view>
		<nav-bars></nav-bars>
		<!-- 企业 -->
		<view class="status">
			<view class="status_img">
				<image v-if="isSign == 1" src="https://dev-liankun-1305433883.cos.ap-guangzhou.myqcloud.com/liankun/static/verification/success.png"></image>
				<image v-else src="https://dev-liankun-1305433883.cos.ap-guangzhou.myqcloud.com/liankun/static/verification/fail.png"></image>
			</view>
			<view>
				<view v-if="isSign == 1" class="status_title">签约成功</view>
				<view v-else class="status_title">签约失败</view>
			</view>
			<view class="status_Back" style="margin-bottom: 20rpx;" @click="ContinueSign">重新签约</view>
			<view class="status_btn" @click="Myknow">我知道了</view>
		</view>
	</view>
</template>
<script>
import Https from '@/service/verification.js';
export default {
	name: '',
	components: {},
	data() {
		return {
			isSign: null,
			Info: null
		};
	},
	onLoad(options) {
		// console.log(options);
		this.getAccountInfo();
	},

	methods: {
		Myknow() {
			uni.navigateBack({
				delta: 1
			});
		},
		ContinueSign() {
			var that = this;
			var data = that.Info;
			uni.navigateToMiniProgram({
				appId: 'wxc46c6d2eed27ca0a', //通商云平台账户小程序appId
				path: 'pages/merchantAddress/merchantAddress',
				extraData: {
					// 测试环境地址：url=https://test.allinpay.com/yungateway/member/signContract.html?
					// 生产环境地址：url=https://fintech.allinpay.com/yungateway/member/signContract.html?
					// targetUrl: 'https://test.allinpay.com/yungateway/member/signContract.html?' + data.signContract.data.param //商户拼接的请求报文
					targetUrl: data.signContract
				},
				envVersion: 'release', //develop 开发版  trial 体验版  release 正式版
				success(res) {
					// 打开成功
					uni.navigateBack({
						delta: 1
					});
				}
			});
		},
		// 查询云商通账户信息
		getAccountInfo() {
			var that = this;
			let params = {};
			Https.GetAccountMes(params).then(res => {
				if (res.code == 1) {
					console.log(res.data);
					// member_type 会员类型(2企业会员,3个人会员)   is_realname 是否实名(0否,1是,2实名审核中)  is_phone	 是否绑定手机(0否,1是)
					// is_sign	是否签约(0否,1是)  signContract 签约参数
					var data = res.data;
					that.Info = data;
					that.isSign = data.is_sign;
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					});
				}
			});
		}
	}
};
</script>
<style lang="less">
page {
	background: #fff;
}
.status {
	padding: 100rpx 50rpx;
	.status_img {
		width: 340rpx;
		height: 340rpx;
		margin: 0 auto;
	}
	.status_title {
		font-size: 42rpx;
		font-weight: bold;
		color: #333333;
		text-align: center;
		margin: 72rpx 0 40rpx 0;
	}
	.status_decs {
		font-size: 26rpx;
		font-weight: 500;
		color: #999999;
		text-align: center;
		padding: 0 56rpx;
		margin-bottom: 100rpx;
	}
	.status_Back {
		height: 90rpx;
		border: 2rpx solid #c3ab7c;
		border-radius: 10rpx;
		font-size: 34rpx;
		font-weight: 500;
		color: #c3ab7c;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.status_btn {
		height: 90rpx;
		background: #c3ab7c;
		border-radius: 10rpx;
		font-size: 34rpx;
		font-weight: 500;
		color: #ffffff;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}
</style>
